package com.agileboot.domain.system.tag.db;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 系统标签表 Mapper
 * 仿照 SysNoticeMapper
 */
public interface SysTagMapper extends BaseMapper<SysTagEntity> {

    /**
     * 分页获取标签列表（关联创建人）
     */
    @Select("SELECT t.* "
            + "FROM sys_tag t "
            + "LEFT JOIN sys_user u ON t.creator_id = u.user_id"
            + " ${ew.customSqlSegment}")
    Page<SysTagEntity> getTagList(Page<SysTagEntity> page,
                                  @Param(Constants.WRAPPER) Wrapper<SysTagEntity> queryWrapper);
}
